package org.kzwl.book.controller.web;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.kzwl.book.controller.annotation.PassToken;
import org.kzwl.comm.pojo.ResponseData;
import org.kzwl.comm.pojo.bo.setting.BannerQueryBO;
import org.kzwl.comm.pojo.dto.setting.BannerQueryDTO;
import org.kzwl.entity.web.CuCarousel;
import org.kzwl.service.app.SettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 张国伟/郭家恒
 * @since 2020-09-10
 */
@RestController
@RequestMapping("/web-setting")
@Api("Web-基础设置")
public class WebSettingController {

    @Autowired
    private SettingService settingService;

    @ApiOperation(value = "查询轮播", notes = "queryType(查询类型  0-图书轮播)--必填")
    @PostMapping("/bannerQuery")
    @PassToken
    public ResponseData<List<CuCarousel>> bannerQuery(@RequestBody BannerQueryBO bo) {
        List<CuCarousel> list = settingService.bannerQuery(bo);
        return new ResponseData<>(list);
    }

}
